package com.jugheadzhou.core.zk.helper;

import com.jugheadzhou.core.zk.ZkClient;
import lombok.Getter;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
public class MythServiceBaseZkHelper {

	@NonNull
	@Getter
	protected final ZkClient zkClient;
	
	@NonNull
	protected final String ip;
	
	@NonNull
	protected final String port;

	protected static final String schema = "/myth/service";

	protected String buildServicePath() {
		return schema + ZkClient.SLASH + this.zkClient.getZkProps().getServiceName();
	} 
	
	public String getServiceLocalUrl() {
		return ip + ":" + port;
	}
}
